/**********************************************************************************
// Bitmap Header File
//
// Creation:	12 Jun 2007
// Updated:		27 Set 2009
// Compiler:	Visual Studio 2008
//
// Comments:	Work with bitmap images
//
**********************************************************************************/

#ifndef _ANABELE_BITMAP_H_
#define _ANABELE_BITMAP_H_

#include <windows.h>	// include important windows stuff
#include <windowsx.h>	// include helpful macros
#include <stdio.h>

/**********************************************************************************/

// make classes and functions exportable to a DLL
#ifdef ANABELE_EXPORTS
#define DLL __declspec( dllexport ) 
#else
#define DLL __declspec( dllimport )
#endif

// universal id for a bitmap
#define BITMAP_ID 0x4D42 

/**********************************************************************************/

class DLL Bitmap
{
private:
	BITMAPFILEHEADER bitmapHeader;	// bitmap header
	BITMAPINFOHEADER bitmapInfo;	// bitmap info
	UCHAR *imgData;					// bitmap image data

	// private methods
	int FlipBitmap(UCHAR *image, int bytes_per_line, int height);

public:
	Bitmap(char *fileName);
	Bitmap();
	~Bitmap();

	int Load(char *fileName);

	UCHAR * GetImageData() const   { return imgData; }
	LONG	GetImageWidth() const  { return bitmapInfo.biWidth; }
	LONG	GetImageHeight() const { return bitmapInfo.biHeight; }
	DWORD	GetImageSize() const   { return bitmapInfo.biSizeImage; }

}; 

#endif